﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=1">
    <meta name="format-detection" content="telephone=no">
    <meta charset="UTF-8">
    <title>使用object与array控制class</title>
    <link href="../css/bootstrap.css"/>
    <link href="../css/bootstrap-theme.css"/>

    <style>
        .blue{
            color: blue;
        }
        .gray{
            color: gray;
        }
        .red{
            color: red;
        }
        .font{
            font-size: 100px;
        }
    </style>
</head>
<body>
    <h1>使用object与array控制class</h1><br/>

    <div id="app">
        {{name}}<br/>
        <p :class="color1">等值操作class</p>
        <p :class="color2">object控制class</p>
        <p :class="color3">array控制class</p>
        <p class="font" :class="color2">vue和源生属性一起生效class</p>
    </div>
<script src="../js/jquery-2.2.0.min.js"></script>
<script src="../js/vue-2.5.16.js"></script>
<script src="../node_modules/axios/dist/axios.js"></script>
<script src="../node_modules/lodash/lodash.js"></script>

<script>
    var app = new Vue({
        el:'#app',
        data:{
            color1:'blue',
            color2:{
                gray:true
            },
            color3:['red','font'],
            name:'模版数据'
        }
    });
</script>

</body>
</html>